#import "SDCaseTableViewController.h"

@interface SDCaseTableViewController ()

@end

@implementation SDCaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    self.tableView.tableFooterView = [[UIView alloc]init];
}



#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    if (_dOnBool) {
        return 5;
    }else{
    
        return 15;
    }
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    if (_dOnBool) {
        switch (indexPath.row) {
            case 0:
                cell.textLabel.text = @"肿瘤科";
                break;
            case 1:
                cell.textLabel.text = @"心血管科";
                break;
            case 2:
                cell.textLabel.text = @"血液科";
                break;
            case 3:
                cell.textLabel.text = @"神经科";
                break;
                
            default:
                cell.textLabel.text = @"骨科";
                break;
        }

    }else{
    
        cell.textLabel.text = [NSString stringWithFormat:@"%@%ld种分类",self.caseString,(long)indexPath.row];
    
    }
    return cell;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    [self.navigationController popViewControllerAnimated:YES];

    _strBoolk(cell.textLabel.text);

    if (_dOnBool) {
        _upDataBool(cell.textLabel.text);
    }


}

 @end
